import { Injectable } from '@angular/core';

@Injectable({ providedIn: 'root' })
export class NotificationContainerService {
  public notifications = [];

  remove(cdr, id): void {
    this.notifications.some((item, index): boolean => {
      if (item.id === id) {
        this.notifications.splice(index, 1);
        cdr.detectChanges();
        return true;
      }
      return false;
    });
  }
}
